function dl(obj)
{
	window.location.href="/sy.php";
	
}
			
			
			layui.use(['carousel','element'], function(){
			  	carousel = layui.carousel;
			  	//建造实例
			  	carousel.render({
			    	elem: '#div51_body-3_1'
			    	,width: '400px' //设置容器宽度
			    	,height: '480px'
			    	//,arrow: 'always' //始终显示箭头
			    	//,anim: 'updown' //切换动画方式
			  	});
			});
			
			
			
			
			
			
			
			
			$(document).ready(function(){
				$.ajax({
					type:"post",
					url:"tiaodl.php",
					data:{
						code:$("#div1>div:nth-child(3)").attr("code")
					},
					dataType:"json",
					success:function(msg){
						console.log(msg);
						if(msg!=null)
									{
										$("#div1>div:nth-child(3)").text("已登录");
									}
					}
				});
				
				
				
				//$("#a11").slideUp(20);
				$("#div3_1").click(function(){
					$("#a11").slideToggle();
				});
				$(".a11_1").mouseenter(function(){
					$("#div5").css("display","block");
					$("#ifm1").attr("src",$(this).attr("ssrc"));
				});
				$(".a11_1").mouseleave(function(){//先鼠标移入才可以鼠标移出
					$("#div5").css("display","none");
				});
				
				$.ajax({
		            type:"post",
		            url:"/syfen.php",
		            success:function(mgs){
		                console.log(mgs);
		            }
		    	});
				
				
				//轮播图
				$.ajax({
					type:"post",
					url:"/sylb.php",
					dataType:"json",
					success:function(mgs){
						console.log(mgs);
						for(var a in mgs)
						{
							console.log(mgs[a]["url"]);
							$(".div_tiao").append('<img src="'+mgs[a]["url"]+'">');
						}
						$(".div_body").find(".div_tiao").append($(".div_body").find(".div_tiao").children("img:first").clone());
					}
				});
				
				var a = 0;
				setIntCode = setInterval(function(){
					a++;
					if(a>3)
					{
						$(".div_tiao").animate({"left":0+"px"},0);
						a=1;
					}
					if(a==3)
					{
						$("[code='1']").addClass("an1");
						$("[code='1']").siblings().removeClass("an1");
					}
					console.log(a);
					$("[code='"+(a+1)+"']").addClass("an1");
					$("[code='"+(a+1)+"']").siblings().removeClass("an1");
					$(".div_tiao").animate({"left":(a*-1454)+"px"},1000);
				},3000);
				
				for (var b = 0;b<$(".div_tiao>img").length-1;b++) {
					$(".an").append("<div code='"+(b+1)+"'></div>")
				}
				$(".an>div:nth-child(1)").addClass("an1");
				
				$(".an>div").click(function(){
					a = parseInt($(this).attr("code"))-1;
					$(".div_tiao").animate({"left":(a*-1454)+"px"},1000);
					$(this).addClass("an1");
					$(this).siblings().removeClass("an1");
				});
				$(".div_body").mouseenter(function(){//鼠标移入了
					clearInterval(setIntCode);
				});
				$(".div_body").mouseleave(function(){//先鼠标移入才可以鼠标移出
					setIntCode = setInterval(function(){
						a++;
						if(a>3)
						{
							
							$(".div_tiao").animate({"left":0+"px"},0);
							a=1;
						}
						
						$(".div_tiao").animate({"left":(a*-1454)+"px"},1000);
					},3000);
				});
			});